<!DOCTYPE html>
<html lang='en'>

<head>
  <meta charset='UTF-8'>
  <meta http-equiv='X-UA-Compatible' content='IE=edge'>
  <meta name='viewport' content='width=device-width, initial-scale=1.0'>
  <title>Document</title>
  <script src='https://cdn.jsdelivr.net/npm/vue/dist/vue.js'></script>
  <style>
    #cpp {
      width: 400px;
      height: 200px;
      background-color: green;
    }
    
    #cpp p {
      width: 200px;
      height: 100px;
      background-color: red;
    }
  </style>
</head>

<body>
  <div id='app'>
    <div @click.once='divClick' id="cpp">我是div
      <p @click.stop="pClick">我是p</p>

    </div>
    <p></p>
    <input @keyup.enter="divDown"></input>
  </div>
  <script>
    const app = new Vue({
      el: '#app',
      data: {
        message: 'hello world'
      },
      methods: {
        divClick() {
          console.log('divClick');
        },
        pClick() {
          console.log('pClick');
        },
        divDown() {
          console.log('divDown');
        }
      }
    })
  </script>
</body>

</html>